Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(DE-830) feat(dbt): add diversity metric in dbt #3655

Merged
merged 3 commits into from
Dec 31, 2024

Conversation

cdelabre-pass
Copy link
Collaborator

DA PR

Describe your changes

Please include a summary of the changes:

  • This PR [adds/removes/fixes/replaces] the [feature/bug/etc].
  • Tag a reviewer if necessacy @github/username

Type of change

  • Fix (non-breaking change which corrects expected behavior)
  • New fields (non-breaking change)
  • New table (non-breaking change)
  • Concept change (potentially breaking change which modifies fields according to new or evolving business concepts)
  • Table deletion (potentially breaking change which adds functionality/ table)

Checklist before requesting a review

  • I have performed a self-review of my code
  • Fields have been snake_cased
  • I have checked my modifications don't break downstream models
  • If my changes concern incremental table, I have altered their schema to accomodate with field's creation/deletion
  • I have made corresponding changes to the tables documentation
  • I have made corresponding changes to the fields glossary
  • I have updated the dag in cases of dependencies
  • My code passes CI/CD tests
  • I will post on slack review channel and ensure to specify the duration of the review task: short (<10min), medium (<30min), long (>30min)

PR title format (except for MEP)

There is a linter on the PR title format. Please respect the following format:

(ticket) type(topic): comment
  • ticket surrounded by parenthesis, with optionnaly a hyphen followed by one or more digits (e.g., -1234). The first part must be one of the following strings:

    • DA
    • DE
    • AE
    • DS
    • HF
    • BSR
    • PC
  • type :
    The second part to specify the type of change one of the following :

    • build
    • lint
    • ci
    • docs
    • feat
    • fix
    • perf
    • refactor
    • test
    • core
    • dbt
  • topic within parenthesis: 1 word e.g., (dag)

  • comment: tell us your life

examples:

  • ✅ (DE-124) refactor(firebase): update source field
  • ❌ (DE-124) refactor (firebase): update source field (space between type and topic)
  • ❌ (DE-124) airflow(firebase): update source fiedd in DAG (wrong type)
  • ❌ (DE-124) (DE-124) refactor(firebase refacto): update source field (topic in two words)
  • ✅ (BSR) docs(github): add PR title valid format in template

@cdelabre-pass cdelabre-pass force-pushed the DE-830/diversification-booking branch from a0e7606 to 2de1162 Compare December 27, 2024 17:12
"type": "OFFER_SUBCATEGORY",
"score_multiplier": 10,
},
{"entity": "venue_id", "type": "VENUE", "score_multiplier": 5},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
{"entity": "venue_id", "type": "VENUE", "score_multiplier": 5},
{
"entity": "venue_id",
"type": "VENUE",
"score_multiplier": 5,
},

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Format par défaut du linter

user_id,
booking_creation_date,
case
when booking_rank = 1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

l. 85/86 pas utile
-> Si booking_rank = 1 alors on aura toujours diversity_booking_entity_rank = 1 non ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Je n'ai pas trouvé la réponse à la question :
Est-ce que le premier incrément est de 0 point, 1 point ou de 25+10+20+5 points maintenant ?
Le case when était là pour ça et j'ai laissé cela en attendant.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

C'est bien 25+10+20+5! Donc "score_multiplier" fonctionne même pour l'initialisation il me semble

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok parfait j'enlève la règle alors :)

row_number() over (
partition by user_id, {{ entity.entity }}
order by booking_created_at
) as diversity_booking_entity_rank
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

malin

@@ -0,0 +1,8 @@
select
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Configurer la table incrémentale, partitionnée sur booking_id ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Les réservations pouvant être annulées, il me semble un peu plus compliqué de mettre la table en incrémentale. Par contre, nous pouvons tout à fait partitionner en fonction de l'usage.

Jules-Arbelot
Jules-Arbelot previously approved these changes Dec 31, 2024
user_id,
booking_creation_date,
case
when booking_rank = 1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

C'est bien 25+10+20+5! Donc "score_multiplier" fonctionne même pour l'initialisation il me semble

Copy link

@cdelabre-pass cdelabre-pass merged commit 8832df8 into master Dec 31, 2024
12 of 13 checks passed
@cdelabre-pass cdelabre-pass deleted the DE-830/diversification-booking branch December 31, 2024 10:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants